@extends('layouts.admin')
@section('content')

    <!--Side menu and right menu -->

    <!-- main content -->
    <section class="content home">
        <div class="container-fluid">
            <div class="block-header">
                <h2>订单管理</h2>
                <ol class="breadcrumb">
                    <li><a href="{{url('admin/')}}">首页</a></li>
                    <li><a href="{{url('admin/order')}}">全部订单</a></li>
                    <li class="active">订单审核</li>
                </ol>

            </div>

            <div class="row clearfix">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h2> 订单编号:{{ $order->sn }}
                                <small>
                                    下单日期：{{ $order->created_at }} </small>
                            </h2>
                            <ul class="header-dropdown m-r--5">
                                <a href="{{ url()->previous() }}" title="返回上一页"> <i class="material-icons">arrow_back</i>
                                </a>

                                </li>
                            </ul>
                        </div>
                        <div class="body">
                            {{--0=提交初审待审核，1=初审通过待支付，2=初审失败、3=支付成功提交复审资料，4=复审资料提交待复审、5=复审失败、6=复审成功--}}
                            <form method="POST" action="">
                                <input name="order_status" value="{{$order->order_status}}" type="hidden"/>
                                <input name="order_type" value="{{$order->order_type}}" type="hidden"/>
                                <input name="id" value="{{$order->id}}" type="hidden"/>
                                {{ csrf_field() }}
                                <div class="row clearfix">
                                    <span class="label {{$order->order_status == 0 ? 'label-success' : 'label-default'}} ">1.初审待审核</span>
                                    <span class="label {{$order->order_status == 1 ? 'label-success' : 'label-default'}}">2.初审通过待支付</span>
                                    @php if($order->order_status == 2 ){echo "<span class=\"label label-success\">初审失败</span>"; } @endphp
                                    <span class="label {{$order->order_status == 3 ? 'label-success' : 'label-default'}}">3.已支付待提交复审</span>
                                    <span class="label {{$order->order_status == 4 ? 'label-success' : 'label-default'}}">4.待复审</span>
                                    @php if($order->order_status == 5 ){echo "<span class=\"label label-success\">复审失败</span>"; } @endphp
                                    <span class="label {{$order->order_status == 6 ? 'label-success' : 'label-default'}}">5.验证成功</span>
                                    <hr/>
                                </div>
                                <h2 class="card-inside-title">申请内容</h2>
                                <div class="row clearfix">
                                    <div class="col-md-4">
                                        {{ $order->order_type ? "企业实名认证" : "官网认证"}} : {{ $order->order_name }}

                                    </div>
                                    <div class="col-md-4">
                                        申请年限：{{$order->company->year}} 年
                                    </div>
                                    <div class="col-sm-4">
                                        企业类型：{{company_type($order->company->company_type)}}
                                    </div>
                                </div>
                                <hr/>
                                <h2 class="card-inside-title">联系方式</h2>

                                <div class="row clearfix">
                                    <div class="col-sm-4">
                                        联系人：{{$order->company->contacts_name}}
                                    </div>
                                    <div class="col-sm-4">
                                        邮箱：{{$order->company->contacts_emal}}
                                    </div>
                                    <div class="col-sm-4">
                                        电话： {{$order->company->contacts_phone}}
                                    </div>
                                </div>
                                <hr/>
                                @if ($order->order_status >= 3)
                                    <h2 class="card-inside-title">支付信息</h2>
                                    <div class="row clearfix">
                                        <div class="col-sm-4">
                                            金额：{{$order->money}}
                                        </div>
                                        <div class="col-sm-4">
                                            支付流水：{{$order->pay_number}}
                                        </div>
                                        <div class="col-sm-4">
                                            支付时间： {{date('Y-m-d H:i:s',$order->pay_time)}}
                                        </div>
                                    </div>
                                    <hr/>
                                @endif
                                @if ($order->order_status >= 4)
                                    <h2 class="card-inside-title">企业实名信息</h2>
                                    <div class="row clearfix">
                                        <div class="col-sm-4">
                                            企业名称：{{$order->company->company_name}}
                                        </div>
                                        <div class="col-sm-4">
                                            公司注册号：{{$order->company->registration_number}}
                                        </div>
                                        <div class="col-sm-4">
                                            统一社会信用代码： {{$order->company->unified_code}}
                                        </div>

                                        <div class="col-sm-4 m-t-5">
                                            法定代表人： {{$order->company->legal_representative}}
                                        </div>
                                        <div class="col-sm-4 m-t-5">
                                            身份证： {{$order->company->id_card}}
                                        </div>
                                        <div class="col-sm-4 m-t-5">
                                            注册资本万人民币：{{$order->company->registered_capital}}
                                        </div>
                                        <div class="col-sm-4 m-t-5">
                                            企业类型：{{company_type($order->company->company_type)}}
                                        </div>
                                        <div class="col-sm-4 m-t-5">
                                            公司成立日期： {{date("Y-m-d",$order->company->company_registration_time)}}
                                        </div>
                                        <div class="col-sm-4 m-t-5">
                                            营业有效时间：{{date("Y-m-d",$order->company->operation_period_start)}}
                                            - {{date("Y-m-d",$order->company->operation_period_end)}}
                                        </div>
                                        <div class="col-sm-4 m-t-5">
                                            登记机关：{{$order->company->registration_authority}}
                                        </div>
                                        <div class="col-sm-8 m-t-5">
                                            公司注册地址： {{$order->company->company_registered_address}}
                                        </div>

                                        <div class="col-sm-12 m-t-5">
                                            营业范围：
                                            <blockquote>
                                                <small> {{$order->company->business_scope}}</small>
                                            </blockquote>
                                        </div>
                                        <div class="col-sm-4 m-t-5">
                                            企业营业执照：<p><img src="{{$order->company->business_license}}" width="20px;"/>
                                            </p>
                                        </div>


                                    </div>
                                    <hr/>

                                @endif
                                @if ($order->order_status == 6)

                                    <div class="alert alert-info">
                                        认证生效日期：{{date("Y-m-d H:i:s",$order->company->effective_date)}}
                                    </div>
                                @elseif ($order->order_status == 1)
                                    <div class="alert alert-info">
                                        <strong>此</strong> 订单待支付费用，无需操作！
                                    </div>
                                @else
                                    <h2 class="card-inside-title">审批操作</h2>
                                    <div class="row clearfix">
                                        <div class="col-sm-12">
                                            <input name="reviewed" value="1" type="radio" id="radio_ok"
                                                   class="with-gap radio-col-cyan" checked/>
                                            <label for="radio_ok">通过</label>
                                            <input name="reviewed" value="0" type="radio" id="radio_no"
                                                   class="with-gap radio-col-orange"/>
                                            <label for="radio_no">拒绝</label>
                                        </div>
                                        <div class="col-sm-12">
                                            <div class="form-group">
                                                <b>备注：
                                                    <small class="Font-6"> (如拒绝，请填写拒绝内容，以供前台用户查看原因)</small>
                                                </b>
                                                <div class="form-line">
                <textarea name="message" rows="4" class="form-control no-resize"
                          placeholder="请输入操作说明..."></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="hidden-print">
                                        <div class="pull-right">

                                            <button type="reset" class="btn  btn-raised bg-grey waves-effect">重置内容
                                            </button>
                                            <button type="submit" class="btn  btn-raised btn-success waves-effect">提交审批
                                            </button>

                                        </div>
                                    </div>
                                @endif
                            </form>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </section>

@endsection

@push('scripts')
    <script src="/assets/plugins/jquery-datatable/jquery.dataTables.js"
    <script>
        $('.js-basic-example').DataTable();
    </script>
@endpush